package com.zhentao.util;

import com.zhentao.model.common.admin.pojo.AdminUser;

public class UserThreadLocalutil {
    private final static ThreadLocal<AdminUser> WM_USER_THREAD_LOCAL=new ThreadLocal<>();

    /*
    * map.put("当前线程“，值)
    * */
    public static void setUser(AdminUser AdminUser){
        WM_USER_THREAD_LOCAL.set(AdminUser);
    }

    /*
    * map.get("当前线程")
    * */
    public static AdminUser getUser(){
        return WM_USER_THREAD_LOCAL.get();
    }

    public static void remove(){
        WM_USER_THREAD_LOCAL.remove();
    }
}
